// import { IsNotEmpty } from 'class-validator';
import { IsNotEmpty, ValidateNested } from 'class-validator';

class OrderDataDTO {
    @IsNotEmpty({ message: "姓名不能为空" })
    name: string;
    @IsNotEmpty({ message: "微信号不能为空" })
    wxname: string;
    @IsNotEmpty({ message: "城市不能为空" })
    city: string;
    @IsNotEmpty({ message: "借款额度不能为空" })
    lendLimitId: number;
    @IsNotEmpty({ message: "借款期限不能为空" })
    lendTimeId: number;
    @IsNotEmpty({ message: "借款目的不能为空" })
    lendAimId: number;
}
class OrderEditDataDTO {
    @IsNotEmpty({ message: "订单id不能为空" })
    orderId: number;
    @IsNotEmpty({ message: "收入不能为空" })
    incomeId: number;
    @IsNotEmpty({ message: "收入类型不能为空" })
    incomeTypeId: number;
    @IsNotEmpty({ message: "社保不能为空" })
    sbId: number;
    @IsNotEmpty({ message: "公积金不能为空" })
    gjjId: number;
    @IsNotEmpty({ message: "工作年限不能为空" })
    workYearId: number;
    @IsNotEmpty({ message: "房产不能为空" })
    houseId: number;
    @IsNotEmpty({ message: "车产不能为空" })
    carId: number;
}

//tslint:disable
export class OrderDto {
    @IsNotEmpty({ message: "访问令牌不能为空" })
    token: string;
    @ValidateNested()
    data: OrderDataDTO;
    // constructor(data: OrderDataDTO) {
    //     this.data = data;
    // }
}

export class OrderEditDto {
    @IsNotEmpty({ message: "访问令牌不能为空" })
    token: string;
    @ValidateNested()
    data: OrderEditDataDTO;
}

export class TokenInfo {
    @IsNotEmpty({ message: "访问令牌不能为空" })
    token: string;
}
